function GetWarn(type) {
	var myData;
	if(type == 1){
		myData = [
			['1', '2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['2', '2010-09-08 12:20:20',"DB2", "192.168.0.3", '3306', "mssql", 		   '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['3', '2010-09-08 12:20:20',"DB3", "192.168.0.4", '3306', "oracle", 		 '192.168.0.1','1234', 'sqlplus', 	'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['4', '2010-09-08 12:20:20',"DB4", "192.168.0.5", '3306', "informix", 	 '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['5', '2010-09-08 12:20:20',"DB5", "192.168.0.6", '3306', "db2", 			   '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['6', '2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'select', 'user', 'select * form user',														'policy2','中危','未处理'],
			['7', '2010-09-08 12:20:20',"DB2", "192.168.0.3", '3306', "mssql", 		   '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','未处理'],
			['8', '2010-09-08 12:20:20',"DB3", "192.168.0.4", '3306', "oracle", 		 '192.168.0.1','1234', 'sqlplus', 	'select', 'user', 'select * form user',														'policy2','中危','未处理'],
			['9', '2010-09-08 12:20:20',"DB4", "192.168.0.5", '3306', "informix", 	 '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','未处理'],
			['10','2010-09-08 12:20:20',"DB5", "192.168.0.6", '3306', "db2", 			   '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','未处理'],
			['11','2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'select', 'user', 'select * form user',														'policy3','中危','未处理']
		];                                                                                            
	}else if(type == 2){                                                                            
		myData = [                                                                                    
			['1', '2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','已处理'],
			['2', '2010-09-08 12:20:20',"DB2", "192.168.0.3", '3306', "mssql", 		   '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','已处理'],
			['3', '2010-09-08 12:20:20',"DB3", "192.168.0.4", '3306', "oracle", 		 '192.168.0.1','1234', 'sqlplus', 	'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','已处理'],
			['4', '2010-09-08 12:20:20',"DB4", "192.168.0.5", '3306', "informix", 	 '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','已处理'],
			['5', '2010-09-08 12:20:20',"DB5", "192.168.0.6", '3306', "db2", 			   '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','已处理'],
			['6', '2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['7', '2010-09-08 12:20:20',"DB2", "192.168.0.3", '3306', "mssql", 		   '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['8', '2010-09-08 12:20:20',"DB3", "192.168.0.4", '3306', "oracle", 		 '192.168.0.1','1234', 'sqlplus', 	'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['9', '2010-09-08 12:20:20',"DB4", "192.168.0.5", '3306', "informix", 	 '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['10','2010-09-08 12:20:20',"DB5", "192.168.0.6", '3306', "db2", 			   '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['11','2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'select', 'user', 'select * form user',														'policy3','中危','已处理']
		];                                                                                            
	}else if(type == 3){                                                                            
		myData = [                                                                                    
			['1', '2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['2', '2010-09-08 12:20:20',"DB2", "192.168.0.3", '3306', "mssql", 		   '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['3', '2010-09-08 12:20:20',"DB3", "192.168.0.4", '3306', "oracle", 		 '192.168.0.1','1234', 'sqlplus', 	'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['4', '2010-09-08 12:20:20',"DB4", "192.168.0.5", '3306', "informix", 	 '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['5', '2010-09-08 12:20:20',"DB5", "192.168.0.6", '3306', "db2", 			   '192.168.0.1','1234', '', 					'insert', 'user', 'insert into user(id int,message varchar(10))',	'policy1','高危','未处理'],
			['6', '2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['7', '2010-09-08 12:20:20',"DB2", "192.168.0.3", '3306', "mssql", 		   '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['8', '2010-09-08 12:20:20',"DB3", "192.168.0.4", '3306', "oracle", 		 '192.168.0.1','1234', 'sqlplus', 	'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['9', '2010-09-08 12:20:20',"DB4", "192.168.0.5", '3306', "informix", 	 '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['10','2010-09-08 12:20:20',"DB5", "192.168.0.6", '3306', "db2", 			   '192.168.0.1','1234', '', 					'select', 'user', 'select * form user',														'policy2','中危','已处理'],
			['11','2010-09-08 12:20:20',"DB1", "192.168.0.2", '3306', "mysql", 		   '192.168.0.1','1234', 'sqlyong', 	'select', 'user', 'select * form user',														'policy3','中危','已处理']
		];
	}

    // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       			{
							name : 'id'
						}, {
							name : 'time'
						}, {
							name : 'server'
						}, {
							name : 'ip'
						}, {
							name : 'port'
						}, {
							name : 'db'
						}, {
							name : 'clientip'
						}, {
							name : 'clientport'
						}, {
							name : 'process'
						}, {
							name : 'operate'
						}, {
							name : 'table'
						}, {
							name : 'sql'
						}, {
							name : 'policy'
						}, {
							name : 'level'
						}, {
							name : 'status'
						}
    ]);

    var store = new Ext.data.GroupingStore({
            reader: reader,
            data: myData,
            sortInfo:{field: 'id', direction: "ASC"},
            groupField:'db'
        });



	var nowpage = new Ext.Toolbar.TextItem('1');
	var countpage = new Ext.Toolbar.TextItem('共1页');
	var now_page = 0;
	var count_page = 0;
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '时间',
							width : 100,
							sortable : true,
							dataIndex : 'time'
						}, {
							header : '服务器',
							width : 70,
							sortable : true,
							dataIndex : 'server'
						}, {
							header : '服务器IP',
							width : 100,
							sortable : true,
							dataIndex : 'ip'
						}, {
							header : '服务器端口',
							width : 70,
							sortable : true,
							dataIndex : 'port'
						}, {
							header : '数据库',
							width : 70,
							sortable : true,
							dataIndex : 'db'
						}, {
							header : '客户端IP',
							width : 100,
							sortable : true,
							dataIndex : 'clientip'
						}, {
							header : '客户端端口',
							width : 70,
							sortable : true,
							dataIndex : 'clientport'
						}, {
							header : '客户端进程',
							width : 100,
							sortable : true,
							dataIndex : 'process'
						}, {
							header : '操作',
							width : 100,
							sortable : true,
							dataIndex : 'operate'
						}, {
							header : '表名',
							width : 70,
							sortable : true,
							dataIndex : 'table'
						}, {
							header : '明细',
							width : 100,
							sortable : true,
							dataIndex : 'sql',
							renderer: renderTopic
						}, {
							header : '策略',
							width : 70,
							sortable : true,
							dataIndex : 'policy'
						}, {
							header : '级别',
							width : 70,
							sortable : true,
							dataIndex : 'level'
						}, {
							header : '状态',
							width : 70,
							sortable : true,
							dataIndex : 'status'
						}],
				sm : sm,
				view: new Ext.grid.GroupingView({
		            forceFit:true,
		            startCollapsed : true ,
		            groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "条" : "条"]})'
		        }),
				tbar : [{
							text : '标记为已处理',
							tooltip : '标记为处理',
							iconCls : 'flag'
						}, '-', {
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
								var s = grid.getSelectionModel().getSelections();
								for (var i = 0; r = s[i]; i++) {
									store.remove(r);
								}
							}
						}, '-', {
							text : '查找',
							tooltip : '查找',
							iconCls : 'search',
							handler : function() {							
								WarnSearchWindows(SearchReturn);
							}
						}, '-', {
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {							
								store.loadData(myData);
							}
						}],
				bbar : [{
					tooltip : '首页',
					handler : function() {
						reflashgriad(0);
					},
					iconCls : 'frist'
				}, {

					tooltip : '上一页',
					handler : function() {
						reflashgriad(now_page - 1);
					},
					iconCls : 'perv'
				}, nowpage, {

					tooltip : '下一页',
					handler : function() {
						reflashgriad(now_page + 1);
					},
					iconCls : 'next'
				}, {

					tooltip : '最后一页',
					handler : function() {
						reflashgriad(Math.ceil(count_page / 20) - 1);
					},
					iconCls : 'last'
				}, {
					xtype : "tbfill"
				}, countpage],
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'grid'
			});
	grid.getSelectionModel().on('selectionchange', function(sm) {
				grid.removeBtn.setDisabled(sm.getCount() < 1);
			});
	function showmessage(value){
		Ext.MessageBox.alert('明细', value);
	}
		function renderTopic(value, p, record){
				
        return String.format("<a href='javascript:void(null)' onclick='javascript:Ext.MessageBox.alert(\"明细\", \"{0}\");'>{1}</a>",value,value);
    }
	function SearchReturn(data){
		var jsondata = Ext.util.JSON.decode(data);
		
	}
	function reflashgriad(page) {
	}
	
	return grid;
}

function WarnSearchWindows(SearchReturn){

	var myData = [
					['1', '服务器1'],
					['2', '服务器2'],
					['3', '服务器3'],
					['4', '服务器4']
				 ];        
	var myData1 = [
					['1', '全部'],
					['2', '高危'],
					['3', '中危'],
					['4', '低危']
				 ];        

	var Search = new Ext.form.FormPanel({
				frame : true,
				layout : 'form',
				region : 'center',
				xtype : 'fieldset',
				autoScroll:true, 
				bodyStyle : 'padding:10px;',
				items : [{
							xtype : 'checkboxgroup',
							fieldLabel : '起始时间',
							name : 'start',
							id : 'start',
							columns : 2,
							vertical : true,
							items : [{
										xtype : 'datefield',
										name : 'startdate',
										id   : 'startdate',
										format: 'Y-m-d',
										value:'${startdate}'
									}, {
										xtype : 'timefield',
										name : 'starttime',
										id   : 'starttime',
										value:'00:00',
										format: 'H:i'
	
									}]
						},{
							xtype : 'checkboxgroup',
							fieldLabel : '结束时间',
							name : 'end',
							id : 'end',
							columns : 2,
							vertical : true,
							items : [{
										xtype : 'datefield',
										name : 'enddate',
										id   : 'enddate',
										format: 'Y-m-d',
										value:'${startdate}'
									}, {
										xtype : 'timefield',
										name : 'endtime',
										id   : 'endtime',
										value:'00:00',
										format: 'H:i'
									}]
						}, {
		            xtype:'fieldset',
		            checkboxToggle:true,
		            title: '选择预设服务器',
		            id:'subnetlist',
		            autoHeight:true,
		            defaults: {width: 210},
		            defaultType: 'textfield',
		            collapsed: false,
		            items :[{
									xtype : 'combo',
									name : 'subnet',
									id : 'subnet',
									fieldLabel: '服务器',
									store : new Ext.data.ArrayStore({
												fields : ['id', 'name'],
												data : myData
											}),
									valueField : 'id',
									displayField : 'name',
									typeAhead : true,
									mode : 'local',
									triggerAction : 'all',
									editable : false,
									value:'1'
							}],
							listeners:{'collapse':function(obj){
		                        Ext.getCmp('ip').expand();     
		                        },
		                        'expand':function(obj){
		                        Ext.getCmp('ip').collapse(true); 
		                        }
		                    }
		        },{
		            xtype:'fieldset',
		            checkboxToggle:true,
		            title: '手工输入',
		            id:'ip',
		            autoHeight:true,
		            defaults: {width: 210},
		            defaultType: 'textfield',
		            collapsed: true,
		            items :[
		            	{
	                    fieldLabel: '服务器ip',
	                    name: 'serverip',
	                    value: '0.0.0.0|0.0.0.0|0.0.0.0'
	                },{
	                    fieldLabel: '服务器端口',
	                    name: 'serverport',
	                    value: '0'
	                },{
	                    fieldLabel: '客户端ip',
	                    name: 'clientip',
	                    value: '0.0.0.0'
	                },{
	                    fieldLabel: '客户端端口',
	                    name: 'clientport',
	                    value: ''
	                },{
	                    fieldLabel: '客户端进程',
	                    name: 'process',
	                    value: ''
	                },{
	                    fieldLabel: '数据库',
	                    name: 'db',
	                    value: ''
	                },{
	                    fieldLabel: '表格',
	                    name: 'table',
	                    value: ''
	                }
		            ],
								listeners:{'collapse':function(obj){
			                        Ext.getCmp('subnetlist').expand();     
			                        },
			                        'expand':function(obj){
			                        Ext.getCmp('subnetlist').collapse(true); 
			                        }
			                    }
		        		},{
										xtype: 'checkboxgroup',
										itemCls: 'x-check-group-alt',
										fieldLabel: '操作',
										columns: 4,
										items: [
										{boxLabel: 'select(选择)', name: 'select',id:'select'},
										{boxLabel: 'insert(插入)', name: 'insert',id:'insert'},
										{boxLabel: 'update(更新)', name: 'update',id:'update'},
										{boxLabel: 'delete(删除)', name: 'delete',id:'delete'},
										{boxLabel: 'truncate(删表)', name: 'truncate',id:'truncate'},
										{boxLabel: 'create(创建)', name: 'create',id:'create'},
										{boxLabel: 'grant(允许)', name: 'grant',id:'grant'},
										{boxLabel: 'drop(删对象)', name: 'drop',id:'drop'},
										{boxLabel: 'rollback(回滚)', name: 'rollback',id:'rollback'},
										{boxLabel: 'alter(改变)', name: 'alter',id:'alter'},
										{boxLabel: 'logout(登出)', name: 'logout',id:'logout'},
										{boxLabel: 'login(登录)', name: 'login',id:'login'},
										{boxLabel: 'call(过程)', name: 'call',id:'call'},
										{boxLabel: 'execute(执行)', name: 'execute',id:'execute'}
										]
							}, {
								xtype : 'textarea',
								name : 'context',
								fieldLabel : '关键字',
								anchor : '100%'
							},{
									xtype : 'combo',
									name : 'level1',
									id : 'level1',
									fieldLabel: '级别',
									store : new Ext.data.ArrayStore({
												fields : ['id', 'name'],
												data : myData1
											}),
									valueField : 'id',
									displayField : 'name',
									typeAhead : true,
									mode : 'local',
									triggerAction : 'all',
									editable : false,
									value:'1'
							}
						]

			});

	var searchWindows = new Ext.Window({
				layout : 'border',
				width : 700,
				height : 620,
				title : "查找",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'search',
				items : [Search],
				plain : true
			});
	searchWindows.addButton({
				text : "查找",
				handler : function() {
					var data = "{startdate:'" + Ext.get("startdate").getValue() + "',enddate:'" + Ext.get("enddate").getValue() + "',context:'" + Ext.get("context").getValue() + "'}";
					SearchReturn(data)
					searchWindows.close();
				}
			});
	searchWindows.addButton({
				text : '取 消',
				handler : function() {
					searchWindows.close();
				}
			});
	searchWindows.show();
}